package io.renren.modules.bs.controller;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.bs.entity.BsDepartmentPatientImgEntity;
import io.renren.modules.bs.service.BsDepartmentPatientImgService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.Map;



/**
 * 
 *
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2019-08-15 23:03:14
 */
@RestController
@RequestMapping("bs/departmentPatientImg")
public class BsDepartmentPatientImgController {
    @Autowired
    private BsDepartmentPatientImgService bsDepartmentPatientImgService;

    /**
     * 列表
     */
    @RequestMapping("/list")

    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = bsDepartmentPatientImgService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{departmentPatientImgId}")

    public R info(@PathVariable("departmentPatientImgId") Long departmentPatientImgId){
		BsDepartmentPatientImgEntity bsDepartmentPatientImg = bsDepartmentPatientImgService.getById(departmentPatientImgId);

        return R.ok().put("bsDepartmentPatientImg", bsDepartmentPatientImg);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")

    public R save(@RequestBody BsDepartmentPatientImgEntity bsDepartmentPatientImg){
		bsDepartmentPatientImgService.save(bsDepartmentPatientImg);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")

    public R update(@RequestBody BsDepartmentPatientImgEntity bsDepartmentPatientImg){
		bsDepartmentPatientImgService.updateById(bsDepartmentPatientImg);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")

    public R delete(@RequestBody Long[] departmentPatientImgIds){
		bsDepartmentPatientImgService.removeByIds(Arrays.asList(departmentPatientImgIds));

        return R.ok();
    }

}
